<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>劳动知识问答与科普</title>
    <!-- Tailwind CSS CDN -->
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/tailwindcss@3.3.0/dist/tailwind.min.css" rel="stylesheet">
    <!-- 自定义样式 -->
    <link href="/css/style.css" rel="stylesheet">
    <!-- Font Awesome CDN -->
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <!-- ECharts CDN -->
    <script src="https://unpkg.com/echarts@5.4.3/dist/echarts.min.js"></script>
    <style>        /* 添加基础高度设置 */
    html, body {
        height: 100%;
        margin: 0;
        padding: 0;
    }
    body {
        display: flex;
        flex-direction: column;
    }
    </style>
</head>
<body class="bg-gray-100 font-sans" style="min-height: 100%;">
<!-- Header -->
<header class="bg-blue-600 text-white p-4 shadow-md">
    <div class="container mx-auto flex justify-between items-center">
        <h1 class="text-3xl font-bold">劳动知识平台</h1>
        <nav>
            <ul class="flex space-x-6">
                <li><a href="javascript:void(0);" class="hover:text-blue-200 transition duration-300">首页</a></li>
                <li><a href="javascript:void(0);" class="hover:text-blue-200 transition duration-300">劳动法规</a></li>
                <li><a href="javascript:void(0);" class="hover:text-blue-200 transition duration-300">案例分析</a></li>
                <li><a href="javascript:void(0);" class="hover:text-blue-200 transition duration-300">联系我们</a></li>
            </ul>
        </nav>
    </div>
</header>
<!-- Main Content -->
<main class="container mx-auto my-8 p-4">
    <div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
        <!-- 修改：将左侧劳动知识问答区替换为AI智能问答 -->
        <section class="lg:col-span-2 bg-white p-6 rounded-lg shadow-lg flex flex-col h-[600px]">
            <h2 class="text-2xl font-semibold text-gray-800 mb-4 flex items-center">
                <i class="fas fa-robot text-purple-500 mr-2"></i> AI劳动知识问答
            </h2>
            <!-- 聊天容器 -->
            <div id="chatContainer" class="flex-1 overflow-y-auto p-4 space-y-4">
                <!-- 示例欢迎消息 -->
                <div class="flex items-start space-x-2">
                    <!-- 添加AI头像图标 -->
                    <i class="fas fa-robot text-purple-500 mr-2"></i>
                    <div class="bg-gray-200 p-3 rounded-lg max-w-md flex items-center">

                        <p class="text-gray-700">您好，请问有什么劳动法律问题需要咨询？</p>
                    </div>
                </div>
            </div>
            <!-- 输入区域 -->
            <div class="mt-4 pt-4 border-t border-gray-200">
                <div class="flex items-center space-x-2">
                    <textarea id="aiQuestionInput" rows="1" placeholder="输入劳动相关问题..."
                              class="flex-1 p-3 border border-blue-500 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500 resize-none"></textarea>
                    <button id="askAIBtn" class="bg-purple-600 text-white p-3 rounded-md hover:bg-purple-700 transition duration-300">
                        <i class="fas fa-paper-plane text-xl"></i>
                    </button>
                </div>
            </div>
        </section>

        <!-- 修改：右侧劳动知识科普调整为全高轮播结构 -->
        <aside class="bg-white p-6 rounded-lg shadow-lg flex flex-col" style="height: 600px;">
            <h2 class="text-2xl font-semibold text-gray-800 mb-4 flex items-center">
                <i class="fas fa-lightbulb text-green-500 mr-2"></i> 劳动知识科普
            </h2>
            <!-- 轮播容器 -->
            <div id="knowledgeCarousel" class="carousel-container flex-1 overflow-hidden relative">
                <div class="carousel-track flex transition-transform duration-500">
                    <!-- 轮播项由JS动态生成 -->
                </div>
                <!-- 导航按钮 -->
                <button class="carousel-btn prev absolute left-2 top-1/2 transform -translate-y-1/2 bg-white p-2 rounded-full shadow-md z-10">
                    <i class="fas fa-chevron-left text-gray-600"></i>
                </button>
                <button class="carousel-btn next absolute right-2 top-1/2 transform -translate-y-1/2 bg-white p-2 rounded-full shadow-md z-10">
                    <i class="fas fa-chevron-right text-gray-600"></i>
                </button>
            </div>
        </aside>
    </div>
    <!-- 知识展示区 -->
    <section class="mt-8 bg-white p-6 rounded-lg shadow-lg">
        <h2 class="text-2xl font-semibold text-gray-800 mb-4 flex items-center">
            <i class="fas fa-book-open text-orange-500 mr-2"></i> 知识展示
        </h2>
        <div id="knowledgeCardsContainer" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
            <!-- 知识卡片将通过JavaScript动态加载 -->
        </div>
    </section>
    <!-- Echarts 图表展示区 (示例，如果需要数据可视化可以启用) -->
    <!-- <section class="mt-8 bg-white p-6 rounded-lg shadow-lg">
        <h2 class="text-2xl font-semibold text-gray-800 mb-4 flex items-center">
            <i class="fas fa-chart-bar text-red-500 mr-2"></i> 劳动纠纷数据分析
        </h2>
        <div id="disputeChart" class="w-full h-96"></div>
    </section> -->
</main>
<!-- Footer -->
<footer class="bg-gray-800 text-white p-6 mt-8">
    <div class="container mx-auto text-center text-sm">
        <p>&copy; 2023 劳动知识平台. All rights reserved.</p>
        <div class="flex justify-center space-x-4 mt-2">
            <a href="javascript:void(0);" class="hover:text-gray-300"><i class="fab fa-weibo"></i></a>
            <a href="javascript:void(0);" class="hover:text-gray-300"><i class="fab fa-weixin"></i></a>
            <a href="javascript:void(0);" class="hover:text-gray-300"><i class="fab fa-qq"></i></a>
        </div>
    </div>
</footer>
<!-- 修改：调整JS文件路径为绝对路径以确保正确加载 -->
<!-- 添加新的脚本标签指向打包后的文件 -->
<script type="module" src="./assets/js/api.js"></script>
<script type="module" src="./assets/js/script.js"></script>
</body>
</html>
